package cn.dy.sbo.web;

import java.util.Locale;

import org.springframework.web.servlet.i18n.SessionLocaleResolver;
import org.springframework.web.util.WebUtils;
import org.springside.modules.utils.web.struts2.Struts2Utils;

import com.opensymphony.xwork2.ActionSupport;

public class LoginAction extends ActionSupport
{
    private static final long serialVersionUID = 1L;
    
    private String local;

    @Override
    public String execute() throws Exception
    {
    	if(local != null){
    		WebUtils.setSessionAttribute(Struts2Utils.getRequest(), SessionLocaleResolver.LOCALE_SESSION_ATTRIBUTE_NAME,new Locale(local));
		}
        return SUCCESS;
    }
    
    public void setLocal(String local) {
		this.local = local;
	}
}
